package com.sptpc.demo1.repository;

import com.sptpc.demo1.model.Drink;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface DrinkRepository extends JpaRepository<Drink,Integer> {
            //    泛型第一个是需要管理的实体类，第二个为主键的类型

    //自定义添加查询功能
    List<Drink> findDrinkByCategory_Id(Integer id);
    //select * from t_drink where category_id=id;
    //select * from t_category where id=id


//    List<Drink> findDrinkByNameLike(String key);
}
